package logic.algorithm.aco;

import java.util.ArrayList;
import logic.objects.Problem;

public class Ant {
	Problem problem;
	ArrayList<Boolean> visited;
	ArrayList<Integer> tour;
	double tour_length;

	public Ant(Problem prob) {
		this.problem = prob;
		visited = new ArrayList<Boolean>();
		tour = new ArrayList<Integer>();
		for (int i = 0; i < problem.getNodes().size(); i++) {
			visited.add(false);
			tour.add(i);
		}
		tour.add(0);
	}

	public void setVisited(int index, Boolean bool) {
		visited.set(index, bool);
	}

	public Boolean getVisited(int index) {
		return visited.get(index);
	}

	public void setTourInstanze(int step, Integer node) {
		tour.set(step, node);
		setVisited(node, true);
	}

	public Integer getTourInstanze(int index) {
		return tour.get(index);
	}

	public double getTourLength() {
		return tour_length;
	}

	public void setTourLength(double length) {
		tour_length = length;
	}

}
